home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / biblio / bibtex / contrib / aaai-named.bst < prev    next >
Text File  |  1992-07-19  |  23KB  |  1,284 lines

  1. %NAME: aaai-named.bst
  2. % BibTeX `aaai-named' style file for BibTeX version 0.99c, LaTeX version 2.09
  3. % This version was made by modifying the master file made by
  4. % Oren Patashnik (PATASHNIK@SCORE.STANFORD.EDU)
  5.  
  6. % Copyright (C) 1985, all rights reserved.
  7. % Modifications Copyright 1988, Peter F. Patel-Schneider
  8. % Copying of this file is authorized only if either
  9. % (1) you make absolutely no changes to your copy, including name, or
  10. % (2) if you do make changes, you name it something other than
  11. % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst.
  12. % This restriction helps ensure that all standard styles are identical.
  13.  
  14. % There are undoubtably bugs in this style.  If you make bug fixes,
  15. % improvements, etc.  please let me know.  My e-mail address is:
  16. %    pfps@spar.slb.com
  17.  
  18. %   Citation format: [author-last-name, year]
  19. %             [author-last-name and author-last-name, year]
  20. %             [author-last-name {\em et al.}, year]
  21. %
  22. %   Reference list ordering: alphabetical by author or whatever passes
  23. %    for author in the absence of one.
  24. %
  25. % This BibTeX style has support for short (year only) citations.  This
  26. % is done by having the citations actually look like
  27. %         \citename{name-info, }year
  28. % The LaTeX style has to have the following
  29. %     \let\@internalcite\cite
  30. %     \def\cite{\def\citename##1{##1}\@internalcite}
  31. %     \def\shortcite{\def\citename##1{}\@internalcite}
  32. %     \def\@biblabel#1{\def\citename##1{##1}[#1]\hfill}
  33. % which makes \shortcite the macro for short citations.
  34.  
  35. ENTRY
  36.   { address
  37.     author
  38.     booktitle
  39.     chapter
  40.     edition
  41.     editor
  42.     howpublished
  43.     institution
  44.     journal
  45.     key
  46.     month
  47.     note
  48.     number
  49.     organization
  50.     pages
  51.     publisher
  52.     school
  53.     series
  54.     title
  55.     type
  56.     volume
  57.     year
  58.   }
  59.   {}
  60.   { label extra.label sort.label }
  61.  
  62. INTEGERS { output.state before.all mid.sentence after.sentence after.block }
  63.  
  64. FUNCTION {init.state.consts}
  65. { #0 'before.all :=
  66.   #1 'mid.sentence :=
  67.   #2 'after.sentence :=
  68.   #3 'after.block :=
  69. }
  70.  
  71. STRINGS { s t }
  72.  
  73. FUNCTION {output.nonnull}
  74. { 's :=
  75.   output.state mid.sentence =
  76.     { ", " * write$ }
  77.     { output.state after.block =
  78.     { add.period$ write$
  79.       newline$
  80.       "\newblock " write$
  81.     }
  82.     { output.state before.all =
  83.         'write$
  84.         { add.period$ " " * write$ }
  85.       if$
  86.     }
  87.       if$
  88.       mid.sentence 'output.state :=
  89.     }
  90.   if$
  91.   s
  92. }
  93.  
  94. FUNCTION {output}
  95. { duplicate$ empty$
  96.     'pop$
  97.     'output.nonnull
  98.   if$
  99. }
  100.  
  101. FUNCTION {output.check}
  102. { 't :=
  103.   duplicate$ empty$
  104.     { pop$ "empty " t * " in " * cite$ * warning$ }
  105.     'output.nonnull
  106.   if$
  107. }
  108.  
  109. FUNCTION {output.bibitem}
  110. { newline$
  111.  
  112.   "\bibitem[" write$
  113.   label write$
  114.   "]{" write$
  115.  
  116.   cite$ write$
  117.   "}" write$
  118.   newline$
  119.   ""
  120.   before.all 'output.state :=
  121. }
  122.  
  123. FUNCTION {fin.entry}
  124. { add.period$
  125.   write$
  126.   newline$
  127. }
  128.  
  129. FUNCTION {new.block}
  130. { output.state before.all =
  131.     'skip$
  132.     { after.block 'output.state := }
  133.   if$
  134. }
  135.  
  136. FUNCTION {new.sentence}
  137. { output.state after.block =
  138.     'skip$
  139.     { output.state before.all =
  140.     'skip$
  141.     { after.sentence 'output.state := }
  142.       if$
  143.     }
  144.   if$
  145. }
  146.  
  147. FUNCTION {not}
  148. {   { #0 }
  149.     { #1 }
  150.   if$
  151. }
  152.  
  153. FUNCTION {and}
  154. {   'skip$
  155.     { pop$ #0 }
  156.   if$
  157. }
  158.  
  159. FUNCTION {or}
  160. {   { pop$ #1 }
  161.     'skip$
  162.   if$
  163. }
  164.  
  165. FUNCTION {new.block.checka}
  166. { empty$
  167.     'skip$
  168.     'new.block
  169.   if$
  170. }
  171.  
  172. FUNCTION {new.block.checkb}
  173. { empty$
  174.   swap$ empty$
  175.   and
  176.     'skip$
  177.     'new.block
  178.   if$
  179. }
  180.  
  181. FUNCTION {new.sentence.checka}
  182. { empty$
  183.     'skip$
  184.     'new.sentence
  185.   if$
  186. }
  187.  
  188. FUNCTION {new.sentence.checkb}
  189. { empty$
  190.   swap$ empty$
  191.   and
  192.     'skip$
  193.     'new.sentence
  194.   if$
  195. }
  196.  
  197. FUNCTION {field.or.null}
  198. { duplicate$ empty$
  199.     { pop$ "" }
  200.     'skip$
  201.   if$
  202. }
  203.  
  204. FUNCTION {emphasize}
  205. { duplicate$ empty$
  206.     { pop$ "" }
  207.     { "{\em " swap$ * "}" * }
  208.   if$
  209. }
  210.  
  211. INTEGERS { nameptr namesleft numnames }
  212.  
  213. FUNCTION {format.names}
  214. { 's :=
  215.   #1 'nameptr :=
  216.   s num.names$ 'numnames :=
  217.   numnames 'namesleft :=
  218.     { namesleft #0 > }
  219.  
  220.     { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
  221.  
  222.       nameptr #1 >
  223.     { namesleft #1 >
  224.         { ", " * t * }
  225.         { numnames #2 >
  226.         { "," * }
  227.         'skip$
  228.           if$
  229.           t "others" =
  230.         { " et~al." * }
  231.         { " and " * t * }
  232.           if$
  233.         }
  234.       if$
  235.     }
  236.     't
  237.       if$
  238.       nameptr #1 + 'nameptr :=
  239.       namesleft #1 - 'namesleft :=
  240.     }
  241.   while$
  242. }
  243.  
  244. FUNCTION {format.authors}
  245. { author empty$
  246.     { "" }
  247.     { author format.names }
  248.   if$
  249. }
  250.  
  251. FUNCTION {format.editors}
  252. { editor empty$
  253.     { "" }
  254.     { editor format.names
  255.       editor num.names$ #1 >
  256.     { ", editors" * }
  257.     { ", editor" * }
  258.       if$
  259.     }
  260.   if$
  261. }
  262.  
  263. FUNCTION {format.title}
  264. { title empty$
  265.     { "" }
  266.  
  267.     { title "t" change.case$ }
  268.  
  269.   if$
  270. }
  271.  
  272. FUNCTION {n.dashify}
  273. { 't :=
  274.   ""
  275.     { t empty$ not }
  276.     { t #1 #1 substring$ "-" =
  277.     { t #1 #2 substring$ "--" = not
  278.         { "--" *
  279.           t #2 global.max$ substring$ 't :=
  280.         }
  281.         {   { t #1 #1 substring$ "-" = }
  282.         { "-" *
  283.           t #2 global.max$ substring$ 't :=
  284.         }
  285.           while$
  286.         }
  287.       if$
  288.     }
  289.     { t #1 #1 substring$ *
  290.       t #2 global.max$ substring$ 't :=
  291.     }
  292.       if$
  293.     }
  294.   while$
  295. }
  296.  
  297. FUNCTION {format.date}
  298. { year empty$
  299.     { month empty$
  300.     { "" }
  301.     { "there's a month but no year in " cite$ * warning$
  302.       month
  303.     }
  304.       if$
  305.     }
  306.     { month empty$
  307.     'year
  308.     { month " " * year * }
  309.       if$
  310.     }
  311.   if$
  312. }
  313.  
  314. FUNCTION {format.btitle}
  315. { title emphasize
  316. }
  317.  
  318. FUNCTION {tie.or.space.connect}
  319. { duplicate$ text.length$ #3 <
  320.     { "~" }
  321.     { " " }
  322.   if$
  323.   swap$ * *
  324. }
  325.  
  326. FUNCTION {either.or.check}
  327. { empty$
  328.     'pop$
  329.     { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  330.   if$
  331. }
  332.  
  333. FUNCTION {format.bvolume}
  334. { volume empty$
  335.     { "" }
  336.     { "volume" volume tie.or.space.connect
  337.       series empty$
  338.     'skip$
  339.     { " of " * series emphasize * }
  340.       if$
  341.       "volume and number" number either.or.check
  342.     }
  343.   if$
  344. }
  345.  
  346. FUNCTION {format.number.series}
  347. { volume empty$
  348.     { number empty$
  349.     { series field.or.null }
  350.     { output.state mid.sentence =
  351.         { "number" }
  352.         { "Number" }
  353.       if$
  354.       number tie.or.space.connect
  355.       series empty$
  356.         { "there's a number but no series in " cite$ * warning$ }
  357.         { " in " * series * }
  358.       if$
  359.     }
  360.       if$
  361.     }
  362.     { "" }
  363.   if$
  364. }
  365.  
  366. FUNCTION {format.edition}
  367. { edition empty$
  368.     { "" }
  369.     { output.state mid.sentence =
  370.     { edition "l" change.case$ " edition" * }
  371.     { edition "t" change.case$ " edition" * }
  372.       if$
  373.     }
  374.   if$
  375. }
  376.  
  377. INTEGERS { multiresult }
  378.  
  379. FUNCTION {multi.page.check}
  380. { 't :=
  381.   #0 'multiresult :=
  382.     { multiresult not
  383.       t empty$ not
  384.       and
  385.     }
  386.     { t #1 #1 substring$
  387.       duplicate$ "-" =
  388.       swap$ duplicate$ "," =
  389.       swap$ "+" =
  390.       or or
  391.     { #1 'multiresult := }
  392.     { t #2 global.max$ substring$ 't := }
  393.       if$
  394.     }
  395.   while$
  396.   multiresult
  397. }
  398.  
  399. FUNCTION {format.pages}
  400. { pages empty$
  401.     { "" }
  402.     { pages multi.page.check
  403.     { "pages" pages n.dashify tie.or.space.connect }
  404.     { "page" pages tie.or.space.connect }
  405.       if$
  406.     }
  407.   if$
  408. }
  409.  
  410. FUNCTION {format.vol.num.pages}
  411. { volume field.or.null
  412.   number empty$
  413.     'skip$
  414.     { "(" number * ")" * *
  415.       volume empty$
  416.     { "there's a number but no volume in " cite$ * warning$ }
  417.     'skip$
  418.       if$
  419.     }
  420.   if$
  421.   pages empty$
  422.     'skip$
  423.     { duplicate$ empty$
  424.     { pop$ format.pages }
  425.     { ":" * pages n.dashify * }
  426.       if$
  427.     }
  428.   if$
  429. }
  430.  
  431. FUNCTION {format.chapter.pages}
  432. { chapter empty$
  433.     'format.pages
  434.     { type empty$
  435.     { "chapter" }
  436.     { type "l" change.case$ }
  437.       if$
  438.       chapter tie.or.space.connect
  439.       pages empty$
  440.     'skip$
  441.     { ", " * format.pages * }
  442.       if$
  443.     }
  444.   if$
  445. }
  446.  
  447. FUNCTION {format.in.ed.booktitle}
  448. { booktitle empty$
  449.     { "" }
  450.     { editor empty$
  451.     { "In " booktitle emphasize * }
  452.     { "In " format.editors * ", " * booktitle emphasize * }
  453.       if$
  454.     }
  455.   if$
  456. }
  457.  
  458. FUNCTION {empty.misc.check}
  459. { author empty$ title empty$ howpublished empty$
  460.   month empty$ year empty$ note empty$
  461.   and and and and and
  462.  
  463.   key empty$ not and
  464.  
  465.     { "all relevant fields are empty in " cite$ * warning$ }
  466.     'skip$
  467.   if$
  468. }
  469.  
  470. FUNCTION {format.thesis.type}
  471. { type empty$
  472.     'skip$
  473.     { pop$
  474.       type "t" change.case$
  475.     }
  476.   if$
  477. }
  478.  
  479. FUNCTION {format.tr.number}
  480. { type empty$
  481.     { "Technical Report" }
  482.     'type
  483.   if$
  484.   number empty$
  485.     { "t" change.case$ }
  486.     { number tie.or.space.connect }
  487.   if$
  488. }
  489.  
  490. FUNCTION {format.article.crossref}
  491. { key empty$
  492.     { journal empty$
  493.     { "need key or journal for " cite$ * " to crossref " * crossref *
  494.       warning$
  495.       ""
  496.     }
  497.     { "In {\em " journal * "\/}" * }
  498.       if$
  499.     }
  500.     { "In " key * }
  501.   if$
  502.   " \cite{" * crossref * "}" *
  503. }
  504.  
  505. FUNCTION {format.crossref.editor}
  506. { editor #1 "{vv~}{ll}" format.name$
  507.   editor num.names$ duplicate$
  508.   #2 >
  509.     { pop$ " et~al." * }
  510.     { #2 <
  511.     'skip$
  512.     { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  513.         { " et~al." * }
  514.         { " and " * editor #2 "{vv~}{ll}" format.name$ * }
  515.       if$
  516.     }
  517.       if$
  518.     }
  519.   if$
  520. }
  521.  
  522. FUNCTION {format.book.crossref}
  523. { volume empty$
  524.     { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
  525.       "In "
  526.     }
  527.     { "Volume" volume tie.or.space.connect
  528.       " of " *
  529.     }
  530.   if$
  531.   editor empty$
  532.   editor field.or.null author field.or.null =
  533.   or
  534.     { key empty$
  535.     { series empty$
  536.         { "need editor, key, or series for " cite$ * " to crossref " *
  537.           crossref * warning$
  538.           "" *
  539.         }
  540.         { "{\em " * series * "\/}" * }
  541.       if$
  542.     }
  543.     { key * }
  544.       if$
  545.     }
  546.     { format.crossref.editor * }
  547.   if$
  548.   " \cite{" * crossref * "}" *
  549. }
  550.  
  551. FUNCTION {format.incoll.inproc.crossref}
  552. { editor empty$
  553.   editor field.or.null author field.or.null =
  554.   or
  555.     { key empty$
  556.     { booktitle empty$
  557.         { "need editor, key, or booktitle for " cite$ * " to crossref " *
  558.           crossref * warning$
  559.           ""
  560.         }
  561.         { "In {\em " booktitle * "\/}" * }
  562.       if$
  563.     }
  564.     { "In " key * }
  565.       if$
  566.     }
  567.     { "In " format.crossref.editor * }
  568.   if$
  569.   " \cite{" * crossref * "}" *
  570. }
  571.  
  572. FUNCTION {article}
  573. { output.bibitem
  574.   format.authors "author" output.check
  575.   new.block
  576.   format.title "title" output.check
  577.   new.block
  578.   crossref missing$
  579.     { journal emphasize "journal" output.check
  580.       format.vol.num.pages output
  581.       format.date "year" output.check
  582.     }
  583.     { format.article.crossref output.nonnull
  584.       format.pages output
  585.     }
  586.   if$
  587.   new.block
  588.   note output
  589.   fin.entry
  590. }
  591.  
  592. FUNCTION {book}
  593. { output.bibitem
  594.   author empty$
  595.     { format.editors "author and editor" output.check }
  596.     { format.authors output.nonnull
  597.       crossref missing$
  598.     { "author and editor" editor either.or.check }
  599.     'skip$
  600.       if$
  601.     }
  602.   if$
  603.   new.block
  604.   format.btitle "title" output.check
  605.   crossref missing$
  606.     { format.bvolume output
  607.       new.block
  608.       format.number.series output
  609.       new.sentence
  610.       publisher "publisher" output.check
  611.       address output
  612.     }
  613.     { new.block
  614.       format.book.crossref output.nonnull
  615.     }
  616.   if$
  617.   format.edition output
  618.   format.date "year" output.check
  619.   new.block
  620.   note output
  621.   fin.entry
  622. }
  623.  
  624. FUNCTION {booklet}
  625. { output.bibitem
  626.   format.authors output
  627.   new.block
  628.   format.title "title" output.check
  629.   howpublished address new.block.checkb
  630.   howpublished output
  631.   address output
  632.   format.date output
  633.   new.block
  634.   note output
  635.   fin.entry
  636. }
  637.  
  638. FUNCTION {inbook}
  639. { output.bibitem
  640.   author empty$
  641.     { format.editors "author and editor" output.check }
  642.     { format.authors output.nonnull
  643.       crossref missing$
  644.     { "author and editor" editor either.or.check }
  645.     'skip$
  646.       if$
  647.     }
  648.   if$
  649.   new.block
  650.   format.btitle "title" output.check
  651.   crossref missing$
  652.     { format.bvolume output
  653.       format.chapter.pages "chapter and pages" output.check
  654.       new.block
  655.       format.number.series output
  656.       new.sentence
  657.       publisher "publisher" output.check
  658.       address output
  659.     }
  660.     { format.chapter.pages "chapter and pages" output.check
  661.       new.block
  662.       format.book.crossref output.nonnull
  663.     }
  664.   if$
  665.   format.edition output
  666.   format.date "year" output.check
  667.   new.block
  668.   note output
  669.   fin.entry
  670. }
  671.  
  672. FUNCTION {incollection}
  673. { output.bibitem
  674.   format.authors "author" output.check
  675.   new.block
  676.   format.title "title" output.check
  677.   new.block
  678.   crossref missing$
  679.     { format.in.ed.booktitle "booktitle" output.check
  680.       format.bvolume output
  681.       format.number.series output
  682.       format.chapter.pages output
  683.       new.sentence
  684.       publisher "publisher" output.check
  685.       address output
  686.       format.edition output
  687.       format.date "year" output.check
  688.     }
  689.     { format.incoll.inproc.crossref output.nonnull
  690.       format.chapter.pages output
  691.     }
  692.   if$
  693.   new.block
  694.   note output
  695.   fin.entry
  696. }
  697.  
  698. FUNCTION {inproceedings}
  699. { output.bibitem
  700.   format.authors "author" output.check
  701.   new.block
  702.   format.title "title" output.check
  703.   new.block
  704.   crossref missing$
  705.     { format.in.ed.booktitle "booktitle" output.check
  706.       format.bvolume output
  707.       format.number.series output
  708.       format.pages output
  709.       address empty$
  710.     { organization publisher new.sentence.checkb
  711.       organization output
  712.       publisher output
  713.       format.date "year" output.check
  714.     }
  715.     { address output.nonnull
  716.       format.date "year" output.check
  717.       new.sentence
  718.       organization output
  719.       publisher output
  720.     }
  721.       if$
  722.     }
  723.     { format.incoll.inproc.crossref output.nonnull
  724.       format.pages output
  725.     }
  726.   if$
  727.   new.block
  728.   note output
  729.   fin.entry
  730. }
  731.  
  732. FUNCTION {conference} { inproceedings }
  733.  
  734. FUNCTION {manual}
  735. { output.bibitem
  736.   author empty$
  737.     { organization empty$
  738.     'skip$
  739.     { organization output.nonnull
  740.       address output
  741.     }
  742.       if$
  743.     }
  744.     { format.authors output.nonnull }
  745.   if$
  746.   new.block
  747.   format.btitle "title" output.check
  748.   author empty$
  749.     { organization empty$
  750.     { address new.block.checka
  751.       address output
  752.     }
  753.     'skip$
  754.       if$
  755.     }
  756.     { organization address new.block.checkb
  757.       organization output
  758.       address output
  759.     }
  760.   if$
  761.   format.edition output
  762.   format.date output
  763.   new.block
  764.   note output
  765.   fin.entry
  766. }
  767.  
  768. FUNCTION {mastersthesis}
  769. { output.bibitem
  770.   format.authors "author" output.check
  771.   new.block
  772.   format.title "title" output.check
  773.   new.block
  774.   "Master's thesis" format.thesis.type output.nonnull
  775.   school "school" output.check
  776.   address output
  777.   format.date "year" output.check
  778.   new.block
  779.   note output
  780.   fin.entry
  781. }
  782.  
  783. FUNCTION {misc}
  784. { output.bibitem
  785.   format.authors output
  786.   title howpublished new.block.checkb
  787.   format.title output
  788.   howpublished new.block.checka
  789.   howpublished output
  790.   format.date output
  791.   new.block
  792.   note output
  793.   fin.entry
  794.   empty.misc.check
  795. }
  796.  
  797. FUNCTION {phdthesis}
  798. { output.bibitem
  799.   format.authors "author" output.check
  800.   new.block
  801.   format.btitle "title" output.check
  802.   new.block
  803.   "PhD thesis" format.thesis.type output.nonnull
  804.   school "school" output.check
  805.   address output
  806.   format.date "year" output.check
  807.   new.block
  808.   note output
  809.   fin.entry
  810. }
  811.  
  812. FUNCTION {proceedings}
  813. { output.bibitem
  814.   editor empty$
  815.     { organization output }
  816.     { format.editors output.nonnull }
  817.   if$
  818.   new.block
  819.   format.btitle "title" output.check
  820.   format.bvolume output
  821.   format.number.series output
  822.   address empty$
  823.     { editor empty$
  824.     { publisher new.sentence.checka }
  825.     { organization publisher new.sentence.checkb
  826.       organization output
  827.     }
  828.       if$
  829.       publisher output
  830.       format.date "year" output.check
  831.     }
  832.     { address output.nonnull
  833.       format.date "year" output.check
  834.       new.sentence
  835.       editor empty$
  836.     'skip$
  837.     { organization output }
  838.       if$
  839.       publisher output
  840.     }
  841.   if$
  842.   new.block
  843.   note output
  844.   fin.entry
  845. }
  846.  
  847. FUNCTION {techreport}
  848. { output.bibitem
  849.   format.authors "author" output.check
  850.   new.block
  851.   format.title "title" output.check
  852.   new.block
  853.   format.tr.number output.nonnull
  854.   institution "institution" output.check
  855.   address output
  856.   format.date "year" output.check
  857.   new.block
  858.   note output
  859.   fin.entry
  860. }
  861.  
  862. FUNCTION {unpublished}
  863. { output.bibitem
  864.   format.authors "author" output.check
  865.   new.block
  866.   format.title "title" output.check
  867.   new.block
  868.   note "note" output.check
  869.   format.date output
  870.   fin.entry
  871. }
  872.  
  873. FUNCTION {default.type} { misc }
  874.  
  875. MACRO {jan} {"January"}
  876.  
  877. MACRO {feb} {"February"}
  878.  
  879. MACRO {mar} {"March"}
  880.  
  881. MACRO {apr} {"April"}
  882.  
  883. MACRO {may} {"May"}
  884.  
  885. MACRO {jun} {"June"}
  886.  
  887. MACRO {jul} {"July"}
  888.  
  889. MACRO {aug} {"August"}
  890.  
  891. MACRO {sep} {"September"}
  892.  
  893. MACRO {oct} {"October"}
  894.  
  895. MACRO {nov} {"November"}
  896.  
  897. MACRO {dec} {"December"}
  898.  
  899. MACRO {acmcs} {"ACM Computing Surveys"}
  900.  
  901. MACRO {acta} {"Acta Informatica"}
  902.  
  903. MACRO {cacm} {"Communications of the ACM"}
  904.  
  905. MACRO {ibmjrd} {"IBM Journal of Research and Development"}
  906.  
  907. MACRO {ibmsj} {"IBM Systems Journal"}
  908.  
  909. MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
  910.  
  911. MACRO {ieeetc} {"IEEE Transactions on Computers"}
  912.  
  913. MACRO {ieeetcad}
  914.  {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
  915.  
  916. MACRO {ipl} {"Information Processing Letters"}
  917.  
  918. MACRO {jacm} {"Journal of the ACM"}
  919.  
  920. MACRO {jcss} {"Journal of Computer and System Sciences"}
  921.  
  922. MACRO {scp} {"Science of Computer Programming"}
  923.  
  924. MACRO {sicomp} {"SIAM Journal on Computing"}
  925.  
  926. MACRO {tocs} {"ACM Transactions on Computer Systems"}
  927.  
  928. MACRO {tods} {"ACM Transactions on Database Systems"}
  929.  
  930. MACRO {tog} {"ACM Transactions on Graphics"}
  931.  
  932. MACRO {toms} {"ACM Transactions on Mathematical Software"}
  933.  
  934. MACRO {toois} {"ACM Transactions on Office Information Systems"}
  935.  
  936. MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
  937.  
  938. MACRO {tcs} {"Theoretical Computer Science"}
  939.  
  940. READ
  941.  
  942. FUNCTION {sortify}
  943. { purify$
  944.   "l" change.case$
  945. }
  946.  
  947. INTEGERS { len }
  948.  
  949. FUNCTION {chop.word}
  950. { 's :=
  951.   'len :=
  952.   s #1 len substring$ =
  953.     { s len #1 + global.max$ substring$ }
  954.     's
  955.   if$
  956. }
  957.  
  958. INTEGERS { et.al.char.used }
  959.  
  960. FUNCTION {initialize.et.al.char.used}
  961. { #0 'et.al.char.used :=
  962. }
  963.  
  964. EXECUTE {initialize.et.al.char.used}
  965.  
  966. FUNCTION {format.lab.names}
  967. { 's :=
  968.   s num.names$ 'numnames :=
  969.  
  970.   numnames #1 =
  971.     { s #1 "{vv }{ll}" format.name$ }
  972.     { numnames #2 =
  973.         { s #1 "{vv }{ll }and " format.name$ s #2 "{vv }{ll}" format.name$ *
  974.         }
  975.         { s #1 "{vv }{ll }\bgroup \em et al.\egroup " format.name$ }
  976.       if$
  977.     }
  978.   if$
  979.  
  980. }
  981.  
  982. FUNCTION {author.key.label}
  983. { author empty$
  984.     { key empty$
  985.  
  986.     { cite$ #1 #3 substring$ }
  987.  
  988.     { key #3 text.prefix$ }
  989.       if$
  990.     }
  991.     { author format.lab.names }
  992.   if$
  993. }
  994.  
  995. FUNCTION {author.editor.key.label}
  996. { author empty$
  997.     { editor empty$
  998.     { key empty$
  999.  
  1000.         { cite$ #1 #3 substring$ }
  1001.  
  1002.         { key #3 text.prefix$ }
  1003.       if$
  1004.     }
  1005.     { editor format.lab.names }
  1006.       if$
  1007.     }
  1008.     { author format.lab.names }
  1009.   if$
  1010. }
  1011.  
  1012. FUNCTION {author.key.organization.label}
  1013. { author empty$
  1014.     { key empty$
  1015.     { organization empty$
  1016.  
  1017.         { cite$ #1 #3 substring$ }
  1018.  
  1019.         { "The " #4 organization chop.word #3 text.prefix$ }
  1020.       if$
  1021.     }
  1022.     { key #3 text.prefix$ }
  1023.       if$
  1024.     }
  1025.     { author format.lab.names }
  1026.   if$
  1027. }
  1028.  
  1029. FUNCTION {editor.key.organization.label}
  1030. { editor empty$
  1031.     { key empty$
  1032.     { organization empty$
  1033.  
  1034.         { cite$ #1 #3 substring$ }
  1035.  
  1036.         { "The " #4 organization chop.word #3 text.prefix$ }
  1037.       if$
  1038.     }
  1039.     { key #3 text.prefix$ }
  1040.       if$
  1041.     }
  1042.     { editor format.lab.names }
  1043.   if$
  1044. }
  1045.  
  1046. FUNCTION {calc.label}
  1047. { type$ "book" =
  1048.   type$ "inbook" =
  1049.   or
  1050.     'author.editor.key.label
  1051.     { type$ "proceedings" =
  1052.     'editor.key.organization.label
  1053.     { type$ "manual" =
  1054.         'author.key.organization.label
  1055.         'author.key.label
  1056.       if$
  1057.     }
  1058.       if$
  1059.     }
  1060.   if$
  1061.   duplicate$
  1062.  
  1063.   "\protect\citename{" swap$ * ", }" *
  1064.   year field.or.null purify$ *
  1065.   'label :=
  1066.   year field.or.null purify$ *
  1067.  
  1068.   sortify 'sort.label :=
  1069. }
  1070.  
  1071. FUNCTION {sort.format.names}
  1072. { 's :=
  1073.   #1 'nameptr :=
  1074.   ""
  1075.   s num.names$ 'numnames :=
  1076.   numnames 'namesleft :=
  1077.     { namesleft #0 > }
  1078.     { nameptr #1 >
  1079.     { "   " * }
  1080.     'skip$
  1081.       if$
  1082.  
  1083.       s nameptr "{vv{ } }{ll{ }}{  ff{ }}{  jj{ }}" format.name$ 't :=
  1084.  
  1085.       nameptr numnames = t "others" = and
  1086.     { "et al" * }
  1087.     { t sortify * }
  1088.       if$
  1089.       nameptr #1 + 'nameptr :=
  1090.       namesleft #1 - 'namesleft :=
  1091.     }
  1092.   while$
  1093. }
  1094.  
  1095. FUNCTION {sort.format.title}
  1096. { 't :=
  1097.   "A " #2
  1098.     "An " #3
  1099.       "The " #4 t chop.word
  1100.     chop.word
  1101.   chop.word
  1102.   sortify
  1103.   #1 global.max$ substring$
  1104. }
  1105.  
  1106. FUNCTION {author.sort}
  1107. { author empty$
  1108.     { key empty$
  1109.     { "to sort, need author or key in " cite$ * warning$
  1110.       ""
  1111.     }
  1112.     { key sortify }
  1113.       if$
  1114.     }
  1115.     { author sort.format.names }
  1116.   if$
  1117. }
  1118.  
  1119. FUNCTION {author.editor.sort}
  1120. { author empty$
  1121.     { editor empty$
  1122.     { key empty$
  1123.         { "to sort, need author, editor, or key in " cite$ * warning$
  1124.           ""
  1125.         }
  1126.         { key sortify }
  1127.       if$
  1128.     }
  1129.     { editor sort.format.names }
  1130.       if$
  1131.     }
  1132.     { author sort.format.names }
  1133.   if$
  1134. }
  1135.  
  1136. FUNCTION {author.organization.sort}
  1137. { author empty$
  1138.     { organization empty$
  1139.     { key empty$
  1140.         { "to sort, need author, organization, or key in " cite$ * warning$
  1141.           ""
  1142.         }
  1143.         { key sortify }
  1144.       if$
  1145.     }
  1146.     { "The " #4 organization chop.word sortify }
  1147.       if$
  1148.     }
  1149.     { author sort.format.names }
  1150.   if$
  1151. }
  1152.  
  1153. FUNCTION {editor.organization.sort}
  1154. { editor empty$
  1155.     { organization empty$
  1156.     { key empty$
  1157.         { "to sort, need editor, organization, or key in " cite$ * warning$
  1158.           ""
  1159.         }
  1160.         { key sortify }
  1161.       if$
  1162.     }
  1163.     { "The " #4 organization chop.word sortify }
  1164.       if$
  1165.     }
  1166.     { editor sort.format.names }
  1167.   if$
  1168. }
  1169.  
  1170. FUNCTION {presort}
  1171.  
  1172. { calc.label
  1173.   sort.label
  1174.   "    "
  1175.   *
  1176.   type$ "book" =
  1177.  
  1178.   type$ "inbook" =
  1179.   or
  1180.     'author.editor.sort
  1181.     { type$ "proceedings" =
  1182.     'editor.organization.sort
  1183.     { type$ "manual" =
  1184.         'author.organization.sort
  1185.         'author.sort
  1186.       if$
  1187.     }
  1188.       if$
  1189.     }
  1190.   if$
  1191.  
  1192.   *
  1193.  
  1194.   "    "
  1195.   *
  1196.   year field.or.null sortify
  1197.   *
  1198.   "    "
  1199.   *
  1200.   title field.or.null
  1201.   sort.format.title
  1202.   *
  1203.   #1 entry.max$ substring$
  1204.   'sort.key$ :=
  1205. }
  1206.  
  1207. ITERATE {presort}
  1208.  
  1209. SORT
  1210.  
  1211. STRINGS { longest.label last.sort.label next.extra }
  1212.  
  1213. INTEGERS { longest.label.width last.extra.num }
  1214.  
  1215. FUNCTION {initialize.longest.label}
  1216. { "" 'longest.label :=
  1217.   #0 int.to.chr$ 'last.sort.label :=
  1218.   "" 'next.extra :=
  1219.   #0 'longest.label.width :=
  1220.   #0 'last.extra.num :=
  1221. }
  1222.  
  1223. FUNCTION {forward.pass}
  1224. { last.sort.label sort.label =
  1225.     { last.extra.num #1 + 'last.extra.num :=
  1226.       last.extra.num int.to.chr$ 'extra.label :=
  1227.     }
  1228.     { "a" chr.to.int$ 'last.extra.num :=
  1229.       "" 'extra.label :=
  1230.       sort.label 'last.sort.label :=
  1231.     }
  1232.   if$
  1233. }
  1234.  
  1235. FUNCTION {reverse.pass}
  1236. { next.extra "b" =
  1237.     { "a" 'extra.label := }
  1238.     'skip$
  1239.   if$
  1240.   label extra.label * 'label :=
  1241.   label width$ longest.label.width >
  1242.     { label 'longest.label :=
  1243.       label width$ 'longest.label.width :=
  1244.     }
  1245.     'skip$
  1246.   if$
  1247.   extra.label 'next.extra :=
  1248. }
  1249.  
  1250. EXECUTE {initialize.longest.label}
  1251.  
  1252. ITERATE {forward.pass}
  1253.  
  1254. REVERSE {reverse.pass}
  1255.  
  1256. FUNCTION {begin.bib}
  1257.  
  1258. { et.al.char.used
  1259.     { "\newcommand{\etalchar}[1]{$^{#1}$}" write$ newline$ }
  1260.     'skip$
  1261.   if$
  1262.   preamble$ empty$
  1263.  
  1264.     'skip$
  1265.     { preamble$ write$ newline$ }
  1266.   if$
  1267.  
  1268.   "\begin{thebibliography}{" "}" * write$ newline$
  1269.  
  1270. }
  1271.  
  1272. EXECUTE {begin.bib}
  1273.  
  1274. EXECUTE {init.state.consts}
  1275.  
  1276. ITERATE {call.type$}
  1277.  
  1278. FUNCTION {end.bib}
  1279. { newline$
  1280.   "\end{thebibliography}" write$ newline$
  1281. }
  1282.  
  1283. EXECUTE {end.bib}
  1284.